const Login = () => import('@views/Login')
const ResourceBoard = () => import('@views/board/ResourceBoard')
const TableBoard = () => import('@views/board/TableBoard')
const Home = () => import('@views/Home.vue')
const errorView = () => import('@views/error/404.vue')
const Enroll = () => import('@views/enroll/EnterpriseForm.vue')
// const BasicTests = () => import('@basic/tests/BasicTests.vue')
// const FormlaTests = () => import('@formla/tests/FormlaTests')
// const TablraTests = () => import('@tablra/tests/TablraTests')
// const ServiceTenantTests = () => import('@service/tests/TenantTests')
// const ServiceQuotationTests = () => import('@service/tests/QuotationTests')
// const ServiceDeviceTests = () => import('@service/tests/DeviceTests')
// const FinanceTests = () => import('@service/tests/FinanceTests')
// const MenuTests = () => import('@menu/tests/MenuTests')
// const BasicComponentsTests = () => import('@/components/tests/BasicComponentsTests.vue')
// const TableValidatorsTests = () => import('@/components/tests/TableValidatorsTests.vue')
// const ColumnTests = () => import('@/components/tests/columnTests/Index')
import orderRouter from "../muster/orderRouter"
import detailsRouter from "../muster/detailsRouter"
import windowOpenRouter from "../muster/windowOpenRouter"
import breadHandle from '../muster/breadHandle'
import userRouter from '../muster/userRouter'
import createContractRouter from "../muster/createContractRouter"
import addCarrierRouter from "../muster/addCarrierRouter"
import oneBillRouter from "../muster/oneBillRouter"
import lineSplittingRouter from "../muster/lineSplittingRouter"
import numSplittingRouter from "../muster/numSplittingRouter"
import quotationDetails from "../muster/quotationRouter"
import oneBillQuoteRouter from "../muster/oneBillQuoteRouter"
import appreciationRouter from "../muster/appreciationRouter"
import wayFeeDetailRouter from "../muster/wayFeeDetailRouter"
import print from "../muster/print"
import transport from "../muster/transport"
import orderPreview from "../muster/orderPreview"
import orderReceiptPhoto from "../muster/orderReceiptPhoto"
import financeRouter from "../muster/financeRouter"
import Version from "@views/version/Version"
import equipmentManage from "../muster/equipmentManage"
import consignerRms from "../muster/consignerRms"
import carrierRms from "../muster/carrierRms"
import profitRms from "../muster/profitRms"
import VehicleImport from "@/components/importExcel/VehicleImport.vue"
import digitalizeDetails from '../muster/digitalizeRouter'
import configManageRouter from "../muster/configManageRouter"
import globalRouter from '../muster/globalRouter'
import prompt from "@views/prompt/Success.vue"

// 1. 定义 (路由) 组件。
// 可以从其他文件 import 进来

// 2. 定义路由
// 每个路由应该映射一个组件。 其中"component" 可以是
// 通过 Vue.extend() 创建的组件构造器，
// 或者，只是一个组件配置对象。
// 我们晚点再讨论嵌套路由。
const routes = [
  // { name: "[测试]Basic", path: "/tests/basic", component: BasicTests },
  // { name: "[测试]Formla", path: "/tests/formla", component: FormlaTests },
  // { name: "[测试]Tablra", path: "/tests/tablra", component: TablraTests },
  // { name: "[测试]Service tenant", path: "/tests/service/tenant", component: ServiceTenantTests },
  // { name: "[测试]Service device", path: "/tests/service/device", component: ServiceDeviceTests },
  // { name: "[测试]Service quotation", path: "/tests/service/quotation", component: ServiceQuotationTests },
  // { name: "[测试]Service finance", path: "/tests/service/finance", component: FinanceTests },
  // { name: "[测试]Menu", path: "/tests/menu", component: MenuTests },
  // { name: "[测试]组件", path: "/tests/components/basic", component: BasicComponentsTests },
  // { name: "[测试]验证", path: "/tests/validators/table", component: TableValidatorsTests },
  // { name: "[测试] Table 列方案", path: "/tests/columnTests", component: ColumnTests },
  { name: "首页", path: "/", component: Home },
  { name: "版本", path: "/version", component: Version },
  { name: "邮箱验证", path: "/prompt", component: prompt },
  { name: "login", path: "/login", meta: { title: "登录" }, component: Login },
  { name: "VehicleImport", path: "/vehicle/import", component: VehicleImport },
  {
    name: "enroll",
    path: "/enroll",
    meta: { title: "注册" },
    component: Enroll
  },
  {
    path: "/",
    name: Home,
    component: Home,
    children: [
      {
        name: "表格", path: "/board/:menuId(\\d+)",
        // meta: {
        //   keepAlive: true
        // },
        component: TableBoard
      },
      {
        name: "资源",
        path: "/board/:board/:dataId(\\d+)?",
        component: ResourceBoard
      },
      ...orderRouter,
      ...breadHandle,
      ...userRouter,
      ...addCarrierRouter,
      ...oneBillRouter,
      ...lineSplittingRouter,
      ...numSplittingRouter,
      ...transport,
      ...financeRouter,
      ...equipmentManage,
      ...consignerRms,
      ...carrierRms,
      ...profitRms,
      ...financeRouter,
      ...orderReceiptPhoto,
      ...digitalizeDetails,
      ...appreciationRouter,
      ...createContractRouter,
      ...detailsRouter,
      ...quotationDetails,
      ...oneBillQuoteRouter,
      ...configManageRouter,
      ...globalRouter
    ]
  },
  ...windowOpenRouter,
  ...print,
  ...orderPreview,
  ...wayFeeDetailRouter,
  {
    path: '/:catchAll(.*)',
    name: 'errorView',
    component: errorView
  }
];

export default routes;
